// pages/check/shopping/map/map.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
add:"",
name:'',
moblie:''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
	  wx.getStorage({
		  key:'uid',
		  success: (e) => {
		  	this.setData({
		  		thid:options.thid,
				uid:e.data.uid
		  	})
		  }
	  })
  },
  map(e){
	  this.setData({
		  add:e.detail.value
	  })
  },
  name(e){
  	  this.setData({
  		  name:e.detail.value
  	  })
  },
  moblie(e){
  	  this.setData({
  		  moblie:e.detail.value
  	  })
  },
  sure(){
	  if(this.data.name!=''&&this.data.moblie!=''&&this.data.add!=''){
		  wx.request({
			  url:getApp().globalData.http1 + 'action=returnOrderApp&yuanyin=' + '&lx=1&mobile=' + this.data.mobile + '&address=' + this.data.add +
				'&uname=' + this.data.name + '&thid=' + this.data.thid + '&uid=' + this.data.uid,
				success: (e) => {
					console.log(e)
					wx.navigateBack({
						delta:2
					})
				}
		  })
	  }else{
		  wx.showToast({
			  title:'请正确填写资料',
			  icon:'none'
		  })
	  }
  }
})